<?php

class ad
{
    public static function get_ad($zone)
    {
		$affiliate = true;
        /*
        static $country;
        if ($country == null)
            $country = udnutil::get_country();
        
        switch($country)
        {
            case "IN":
                $affiliate = false;
                break;
            case "X":
                return "";
        }
		*/
        //echo "[".$country."]";

        $scripts['udnmovies.info']['title'] =                  ad::get_AffiliateRobot('title');
        $scripts['udnmovies.info']['title_2'] =                ad::get_AffiliateRobot('title_2');
        $scripts['udnmovies.info']['left_box_1'] =             $affiliate ? ad::get_AffiliateRobot('left_box_1') : ad::get_revenueHits('left_box_1');           //small box under poster
        $scripts['udnmovies.info']['left_bar_1'] =             ad::get_AffiliateRobot('left_bar_1');//             ad::get_techCPM('left_bar_1');               //skyscraper box under actors
        $scripts['udnmovies.info']['left_bar_2'] =             "";                                                                                         //second skyscraper box under actors
        $scripts['udnmovies.info']['center_banner_1'] =        $affiliate ? ad::get_AffiliateRobot('center_banner_1') : ad::get_revenueHits('center_banner_1'); //main banner
        $scripts['udnmovies.info']['center_banner_2'] =        "";                                                                                         //between trailer and downloads
        $scripts['udnmovies.info']['center_banner_3'] =        $affiliate ? ad::get_AffiliateRobot('center_banner_3') : ad::get_revenueHits('center_banner_1'); //after similar and before reviews
        $scripts['udnmovies.info']['on_download'] =            $affiliate ? "" : ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'on_download');                 //download button
        $scripts['udnmovies.info']['overlay_download'] =       $affiliate ? "" : ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'overlay_download');            //hidden overlay on top of download links
        $scripts['udnmovies.info']['fake_download'] =          $affiliate ? "" : ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download');              //hidden overlay on top of image right after the tabs
        $scripts['udnmovies.info']['small_banner_1'] =         ad::get_techCPM('small_banner_1');//
        $scripts['udnmovies.info']['small_banner_2'] =         ad::get_yllix('small_banner_1');//
        $scripts['udnmovies.info']['small_banner_3'] =         ad::get_techCPM('small_banner_1');//ad::get_CPMadserver('small_banner_1');
        $scripts['udnmovies.info']['small_banner_4'] =         ad::get_techCPM('small_banner_1');//ad::get_technoratiMedia('center_banner_1');
        $scripts['udnmovies.info']['download_page_center'] =   $affiliate ? ad::get_AffiliateRobot('download_page_center') : ad::get_revenueHits('center_banner_1');
        $scripts['udnmovies.info']['pop'] =                    $affiliate ? ad::get_AffiliateRobot('pop') : ""; //dialog
        $scripts['udnmovies.info']['popunder'] =               $affiliate ? "" : ad::get_revenueHits('popunder'); //popunder


 /*       $scripts['earnmovie.com']['title'] =                ad::get_AffiliateRobot('title');
        $scripts['earnmovie.com']['title_2'] =              ad::get_AffiliateRobot('title_2');
        $scripts['earnmovie.com']['left_box_1'] =           ad::get_AffiliateRobot('left_box_1');//           ad::get_revenueHits('left_box_1'); //small box under poster
        $scripts['earnmovie.com']['left_bar_1'] =           ad::get_AffiliateRobot('left_bar_1');
        $scripts['earnmovie.com']['center_banner_1'] =      ad::get_AffiliateRobot('center_banner_1');//      ad::get_revenueHits('center_banner_1'); //main banner
        $scripts['earnmovie.com']['center_banner_2'] ="";//      ad::get_revenueHits('center_banner_1'); //between trailer and downloads
        $scripts['earnmovie.com']['center_banner_3'] =      ad::get_AffiliateRobot('center_banner_3');//      ad::get_propeller('center_banner_1'); //after similar and before reviews
        $scripts['earnmovie.com']['on_download'] ="";//          ad::put_in_container(ad::get_yllix('center_banner_1'), 'on_download'); //download button
        $scripts['earnmovie.com']['overlay_download'] ="";//     "";//ad::put_in_container(ad::get_yllix('center_banner_1'), 'overlay_download'); //hidden overlay on top of download links
        $scripts['earnmovie.com']['fake_download'] =        ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download'); //hidden overlay on top of image right after the tabs

        $scripts['getmovielinks.com']['title'] =                  ad::get_AffiliateRobot('title');
        $scripts['getmovielinks.com']['title_2'] =                  ad::get_AffiliateRobot('title_2');
        $scripts['getmovielinks.com']['left_box_1'] = ad::get_AffiliateRobot('left_box_1');//       ad::get_revenueHits('left_box_1'); //small box under poster
        $scripts['getmovielinks.com']['left_bar_1'] =ad::get_AffiliateRobot('left_bar_1');
        $scripts['getmovielinks.com']['center_banner_1'] =  ad::get_AffiliateRobot('center_banner_1'); //main banner
        $scripts['getmovielinks.com']['center_banner_2'] ="";//  ad::get_revenueHits('center_banner_1'); //between trailer and downloads
        $scripts['getmovielinks.com']['center_banner_3'] =ad::get_AffiliateRobot('center_banner_3');//  ad::get_propeller('center_banner_1'); //after similar and before reviews
        $scripts['getmovielinks.com']['on_download'] ="";//      ad::put_in_container(ad::get_yllix('center_banner_1'), 'on_download'); //download button
        $scripts['getmovielinks.com']['overlay_download'] = "";//ad::put_in_container(ad::get_yllix('center_banner_1'), 'overlay_download'); //hidden overlay on top of download links
        $scripts['getmovielinks.com']['fake_download'] = ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download'); //hidden overlay on top of image right after the tabs

        $scripts['moviezfind.com']['title'] =                  ad::get_AffiliateRobot('title');
        $scripts['moviezfind.com']['title_2'] =                  ad::get_AffiliateRobot('title_2');
        $scripts['moviezfind.com']['left_box_1'] = ad::get_AffiliateRobot('left_box_1');//          ad::get_revenueHits('left_box_1'); //small box under poster
        $scripts['moviezfind.com']['left_bar_1'] =ad::get_AffiliateRobot('left_bar_1');
        $scripts['moviezfind.com']['center_banner_1'] =     ad::get_AffiliateRobot('center_banner_1'); //main banner
        $scripts['moviezfind.com']['center_banner_2'] ="";//     ad::get_revenueHits('center_banner_1'); //between trailer and downloads
        $scripts['moviezfind.com']['center_banner_3'] =ad::get_AffiliateRobot('center_banner_3');//     ad::get_propeller('center_banner_1'); //after similar and before reviews
        $scripts['moviezfind.com']['on_download'] ="";//         ad::put_in_container(ad::get_yllix('center_banner_1'), 'on_download'); //download button
        $scripts['moviezfind.com']['overlay_download'] ="";//    "";//ad::put_in_container(ad::get_yllix('center_banner_1'), 'overlay_download'); //hidden overlay on top of download links
        $scripts['moviezfind.com']['fake_download'] = ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download'); //hidden overlay on top of image right after the tabs

        $scripts['moviezhunt.com']['title'] =                  ad::get_AffiliateRobot('title');
        $scripts['moviezhunt.com']['title_2'] =                  ad::get_AffiliateRobot('title_2');
        $scripts['moviezhunt.com']['left_box_1']  = ad::get_AffiliateRobot('left_box_1');//          ad::get_revenueHits('left_box_1'); //small box under poster
        $scripts['moviezhunt.com']['left_bar_1'] =ad::get_AffiliateRobot('left_bar_1');
        $scripts['moviezhunt.com']['center_banner_1'] =     ad::get_AffiliateRobot('center_banner_1'); //main banner
        $scripts['moviezhunt.com']['center_banner_2'] ="";//     ad::get_revenueHits('center_banner_1'); //between trailer and downloads
        $scripts['moviezhunt.com']['center_banner_3'] =ad::get_AffiliateRobot('center_banner_3');//     ad::get_propeller('center_banner_1'); //after similar and before reviews
        $scripts['moviezhunt.com']['on_download'] ="";//         ad::put_in_container(ad::get_yllix('center_banner_1'), 'on_download'); //download button
        $scripts['moviezhunt.com']['overlay_download'] ="";//    "";//ad::put_in_container(ad::get_yllix('center_banner_1'), 'overlay_download'); //hidden overlay on top of download links
        $scripts['moviezhunt.com']['fake_download'] = ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download'); //hidden overlay on top of image right after the tabs

        $scripts['ttmoviez.com']['title'] =                  ad::get_AffiliateRobot('title');
        $scripts['ttmoviez.com']['title_2'] =                  ad::get_AffiliateRobot('title_2');
        $scripts['ttmoviez.com']['left_box_1'] = ad::get_AffiliateRobot('left_box_1');//            ad::get_revenueHits('left_box_1'); //small box under poster
        $scripts['ttmoviez.com']['left_bar_1'] = ad::get_AffiliateRobot('left_bar_1');
        $scripts['ttmoviez.com']['center_banner_1'] =       ad::get_AffiliateRobot('center_banner_1'); //main banner
        $scripts['ttmoviez.com']['center_banner_2'] ="";//       ad::get_revenueHits('center_banner_1'); //between trailer and downloads
        $scripts['ttmoviez.com']['center_banner_3'] =ad::get_AffiliateRobot('center_banner_3');//       ad::get_propeller('center_banner_1'); //after similar and before reviews
        $scripts['ttmoviez.com']['on_download'] ="";//           ad::put_in_container(ad::get_yllix('center_banner_1'), 'on_download'); //download button
        $scripts['ttmoviez.com']['overlay_download'] ="";//      "";//ad::put_in_container(ad::get_yllix('center_banner_1'), 'overlay_download'); //hidden overlay on top of download links
        $scripts['ttmoviez.com']['fake_download'] = ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download'); //hidden overlay on top of image right after the tabs

        $scripts['udnmovies.com']['title'] =                  ad::get_AffiliateRobot('title');
        $scripts['udnmovies.com']['title_2'] =                  ad::get_AffiliateRobot('title_2');
        $scripts['udnmovies.com']['left_box_1'] = ad::get_AffiliateRobot('left_box_1');//           ad::get_revenueHits('left_box_1'); //small box under poster
        $scripts['udnmovies.com']['left_bar_1'] = ad::get_AffiliateRobot('left_bar_1');
        $scripts['udnmovies.com']['center_banner_1'] =      ad::get_AffiliateRobot('center_banner_1'); //main banner
        $scripts['udnmovies.com']['center_banner_2'] ="";//      "";//ad::get_revenueHits('center_banner_1'); //between trailer and downloads
        $scripts['udnmovies.com']['center_banner_3'] =ad::get_AffiliateRobot('center_banner_3');//      ad::get_propeller('center_banner_1'); //after similar and before reviews
        $scripts['udnmovies.com']['on_download'] ="";//          ad::put_in_container(ad::get_yllix('center_banner_1'), 'on_download'); //download button
        $scripts['udnmovies.com']['overlay_download'] ="";//     "";//ad::put_in_container(ad::get_yllix('center_banner_1'), 'overlay_download'); //hidden overlay on top of download links
        $scripts['udnmovies.com']['fake_download'] = ad::put_in_container(ad::get_revenueHits('center_banner_1'), 'fake_download'); //hidden overlay on top of image right after the tabs
*/
        $domain = ad::get_domain();

        if($scripts[$domain] == null || $scripts[$domain][$zone] == null)
            $domain = 'udnmovies.info';

        return $scripts[$domain][$zone];
    }

    public static function put_in_container($script, $container)
    {
        include('config.php');
        $output = '';
        switch ($container)
        {
            case 'on_download': //creates a big download button with an invisible ad overlay on top of it
                ob_start(); ?>
                <div style="position: absolute; margin-top: 60px; opacity: 0.0; width: 728px; height: 90px; z-index: 300;">
                    <?=$script?>
                </div>
                <div id="download_btn"><img  alt="Click to Download" src="http://<?=$res_server?>/res/img/download_btn.png" /></div>
                <?php $output = ob_get_clean();
                break;
            case 'overlay_download': //creates invisible div overlay with the ad inside it
                ob_start(); ?>
                <div style="position: absolute; margin-top:70px; opacity: 0.0; width: 728px; height: 90px; z-index: 300;">
                    <?=$script?>
                </div>
                <?php $output = ob_get_clean();
                break;
            case 'fake_download': //creates a standard leaderboard sized banner with download buttons image that is overlayed by the invisible ad banner
                ob_start(); ?>
                <div style="position: absolute; opacity: 0.0; width: 728px; height: 90px; z-index: 300;">
                    <?=$script?>
                </div>
                <img src="http://<?=$res_server?>/res/img/banner.png" />
                <?php $output = ob_get_clean();
                break;
        }
        return $output;
    }

    private static function get_domain()
    {
        switch(str_replace('www.','',$_SERVER['SERVER_NAME']))
        {
            case 'localhost':
            case 'sharptorrents.com':
            case 'torrentmovies.de':
                return 'udnmovies.info';
            default:
                return str_replace('www.','',$_SERVER['SERVER_NAME']);
        }
    }

    public static function get_revenueHits($zone)
    {
        $codes['udnmovies.info']['left_box_1'] =           'UDNWEB_1466_2';
        $codes['udnmovies.info']['center_banner_1'] =      'UDNWEB_1466_0';
        $codes['udnmovies.info']['popunder'] =             'UDNPP1';

        $codes['earnmovie.com']['left_box_1'] =         'UDNWEB_1798_0';
        $codes['earnmovie.com']['center_banner_1'] =    'UDNWEB_1798_1';

        $codes['getmovielinks.com']['left_box_1'] =     'UDNWEB_1799_0';
        $codes['getmovielinks.com']['center_banner_1'] ='UDNWEB_1799_1';

        $codes['moviezfind.com']['left_box_1'] =        'UDNWEB_1800_0';
        $codes['moviezfind.com']['center_banner_1'] =   'UDNWEB_1800_1';

        $codes['moviezhunt.com']['left_box_1'] =        'UDNWEB_1770_0';
        $codes['moviezhunt.com']['center_banner_1'] =   'UDNWEB_1770_1';

        $codes['ttmoviez.com']['left_box_1'] =          'UDNWEB_1801_0';
        $codes['ttmoviez.com']['center_banner_1'] =     'UDNWEB_1801_1';

        $codes['udnmovies.com']['center_banner_1'] =     'UDNWEB_2269_0';

        $codes['torrentmovies.de']['center_banner_1'] =  'UDNWEB_2234_0';

        $codes['sharptorrents.com']['center_banner_1'] =  'UDNWEB_2270_0';



        $domain = ad::get_domain();
        $output = '';

        if($codes[$domain][$zone] == null) //make sure the domain has an entry above
            $domain = "udnmovies.info"; //default
        switch ($zone)
        {
            case 'left_box_1':
                ob_start(); ?>
                <!-- RevenueHits left_box_1-->
                <script type="text/javascript">pb_cid='<?=$codes[$domain][$zone];?>';pb_type='banner_180x150';</script><script src="http://clkads.com/banners/script/include_img_banner.js" type="text/javascript"></script>
                <?php $output = ob_get_clean();
                break;
            case 'center_banner_1':
                ob_start(); ?>
                <!-- RevenueHits center_banner_1-->
                <script type="text/javascript" src="http://clkrev.com/adServe/banners?tid=<?=$codes[$domain][$zone];?>&amp;size=728x90" ></script>
                <?php $output = ob_get_clean();
                break;
            case 'popunder':
                ob_start(); ?>
                <script type="text/javascript" src="http://clkmon.com/adServe/banners?tid=UDNPP1"></script>
                <?php $output = ob_get_clean();
                break;
        }
        return $output;
    }

    public static function get_yllix($zone)
    {
        $codes['udnmovies.info']['center_banner_1'] =      '277524';
        $codes['earnmovie.com']['center_banner_1'] =    '277524';
        $codes['getmovielinks.com']['center_banner_1'] ='277524';
        $codes['moviezfind.com']['center_banner_1'] =   '277524';
        $codes['moviezhunt.com']['center_banner_1'] =   '277524';
        $codes['ttmoviez.com']['center_banner_1'] =     '277524';
        $codes['udnmovies.com']['center_banner_1'] =    '277524';

        $domain = ad::get_domain();
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'center_banner_1':
                    ob_start(); ?>
                    <!-- yllix center_banner_1-->
                    <iframe src="http://yllix.com/banner_show.php?section=General&amp;pub=<?=$codes[$domain][$zone];?>&amp;format=728x90&amp;ga=g" frameborder="0" scrolling="no" width="728" height="90" marginwidth="0" marginheight="0"></iframe>
                    <?php $output = ob_get_clean();
                    break;
                case 'small_banner_1':
                    ob_start(); ?>
                    <iframe src="http://yllix.com/banner_show.php?section=General&amp;pub=277524&amp;format=468x60&amp;ga=g" frameborder="0" scrolling="no" width="468" height="60" marginwidth="0" marginheight="0"></iframe>
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    private static function get_propeller($zone)
    {
        $codes['udnmovies.info']['center_banner_1'] = '277524'; //TODO:Find how different codes are assembled, now use satic below

        $domain = ad::get_domain();
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'center_banner_1':
                    ob_start(); ?>
                    <iframe id='ad73a73f' name='ad73a73f' src='http://ad.propellerads.com/afr.php?zoneid=3170' frameborder='0' scrolling='no' width='728' height='90'><a href='http://ad.propellerads.com/ck.php?n=ad886a87' target='_blank'><img src='http://ad.propellerads.com/avw.php?zoneid=3170&n=ad886a87' border='0' alt='' /></a></iframe>
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    private static function get_techCPM($zone)
    {
        $codes['udnmovies.info']['center_banner_1'] = '805/1696/1'; //TODO:Find how different codes are assembled, now use satic below
        $codes['udnmovies.info']['center_banner_1'] = '805/1696/3'; //TODO:Find how different codes are assembled, now use satic below

        $domain = ad::get_domain();
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'center_banner_1':
                    ob_start(); ?>
                    <!-- TechCpm.Com Ad Code For http://udnmovies.info -->
                    <script src="http://ads.techcpm.com/techcpm/adscode/805/1696/1.js" type="text/javascript"></script>
                    <!-- Size: 728x90 -->
                    <?php $output = ob_get_clean();
                    break;
                case 'left_bar_1':
                    ob_start(); ?>
                    <!-- TechCpm.Com Ad Code For http://udnmovies.info -->
                    <script src="http://ads.techcpm.com/techcpm/adscode/805/1696/3.js" type="text/javascript"></script>
                    <!-- Size: 160x600 -->
                    <?php $output = ob_get_clean();
                    break;
                case 'small_banner_1':
                    ob_start(); ?>

                    <script src="http://ads.techcpm.com/techcpm/adscode/805/1696/4.js" type="text/javascript"></script>
                    
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    private static function get_technoratiMedia($zone)
    {
        $codes['udnmovies.info']['center_banner_1'] = '805/1696/1'; //TODO:Find how different codes are assembled, now use satic below
        $codes['udnmovies.info']['left_bar_1'] = '805/1696/3'; //TODO:Find how different codes are assembled, now use satic below

        $domain = ad::get_domain();
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'center_banner_1':
                    ob_start(); ?>
                    <!-- BEGIN TECHNORATI MEDIA TAG -->
                    <script type="text/javascript">
                        document.write('<scri' + 'pt type="text/javascript" src="'
                            + (document.location.protocol == 'https:' ? 'https://uat-secure' : 'http://ad-cdn')
                            + '.technoratimedia.com/00/20/98/uat_29820.js?ad_size=728x90"></scri' + 'pt>');
                    </script>
                    <!-- END TECHNORATI MEDIA TAG -->
                    <?php $output = ob_get_clean();
                    break;
                case 'left_bar_1':
                    ob_start(); ?>
                    <!-- BEGIN TECHNORATI MEDIA TAG -->
                    <script type="text/javascript">
                        document.write('<scri' + 'pt type="text/javascript" src="'
                            + (document.location.protocol == 'https:' ? 'https://uat-secure' : 'http://ad-cdn')
                            + '.technoratimedia.com/00/20/98/uat_29820.js?ad_size=160x600"></scri' + 'pt>');
                    </script>
                    <!-- END TECHNORATI MEDIA TAG -->
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    private static function get_CPMadserver($zone)
    {
        $codes['udnmovies.info']['small_banner_1'] = '277524'; //TODO:Find how different codes are assembled, now use satic below

        $domain = ad::get_domain();
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'center_banner_2':
                    ob_start(); ?>
                    <script language='JavaScript' type='text/javascript' src='http://www.cpmadserver.com/adx.js'></script>
                    <script language='JavaScript' type='text/javascript'>
                        <!--
                        if (!document.cpmAds_used) document.cpmAds_used = ',';
                        cpmAds_random = new String (Math.random()); cpmAds_random = cpmAds_random.substring(2,11);

                        document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
                        document.write ("http://www.cpmadserver.com/adjs.php?n=" + cpmAds_random);
                        document.write ("&amp;what=zone:45");
                        document.write ("&amp;exclude=" + document.cpmAds_used);
                        if (document.referrer)
                            document.write ("&amp;referer=" + escape(document.referrer));
                        document.write ("'><" + "/script>");
                        //-->
                    </script><noscript><a href='http://www.cpmadserver.com/adclick.php?n=a8b6dcb0' target='_blank'><img src='http://www.cpmadserver.com/adview.php?what=zone:45&amp;n=a8b6dcb0' border='0' alt=''></a></noscript>
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    private static function get_AffiliateRobot($zone)
    {
        include('config.php');
        $codes['udnmovies.info']['title'] = ''; //TODO:Find how different codes are assembled, now use satic below

        $domain = ad::get_domain();
        $domain = 'udnmovies.info'; //forced override
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'title':
                    ob_start(); ?>
                    <a href="http://www.webtrackerplus.com/?page=flowplayer&a_aid=51a4de24b6608&a_bid=72491354">
                        <img src="http://<?=$res_server?>/res/img/STREAM.gif" />
                    </a>
                    <?php $output = ob_get_clean();
                    break;
                case 'title_2':
                    ob_start(); ?>
                    <a href="http://www.webtrackerplus.com/?page=flowplayer&a_aid=51a4de24b6608&a_bid=72491354">
                        <img src="http://affiliate-robot.com/accounts/default1/banners/download_now.png" />
                    </a>
                    <?php $output = ob_get_clean();
                    break;
                case 'center_banner_1':
                    ob_start(); ?>
                    <a href="http://www.webtrackerplus.com/?page=flowplayer&a_aid=51a4de24b6608&a_bid=72491354"><img class="nohover" src="http://cdn1.clkrev.com/ext/ibario/27/dpp_728_90_blue-copy.png" alt="" title="" width="728" height="90" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'center_banner_3':
                    ob_start(); ?>
                    <a href="http://www.webtrackerplus.com/?a_aid=51a4de24b6608&amp;a_bid=99507c09"><img class="nohover" src="http://<?=$res_server?>/res/img/mymoviepass_728x90anim.gif" alt="" title="" width="728" height="90" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'left_box_1':
                    ob_start(); ?>
                    <a  href="http://www.webtrackerplus.com/?a_aid=51a4de24b6608&amp;a_bid=99507c09" target="_blank"><img src="res/img/stream.jpg" alt="" title="" style="width:214px;" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'left_bar_1':
                    ob_start(); ?>
                    <a  href="http://www.webtrackerplus.com/?a_aid=51a4de24b6608&amp;a_bid=99507c09" target="_blank"><img src="http://www.affiliate-robot.com/accounts/default1/banners/watch%20movies%20anytime%20anywhere.jpg" alt="" title="" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'download_page_center':
                    ob_start(); ?>
                    <a  href="http://www.webtrackerplus.com/?a_aid=51a4de24b6608&amp;a_bid=99507c09" target="_blank"><img src="http://www.affiliate-robot.com/accounts/default1/banners/stream%20thousands%20of%20movies%20in%20hd%20black.jpg" alt="" title="" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'pop':
                    ob_start(); ?>
                    <script>
                        $(function() {
                            $( "#dialog-modal-pop" ).dialog({
                                height: 470,
                                width: 830,
                                modal: true
                            });
                        });
                    </script>
                    <div id="dialog-modal-pop" title="Special Offer!">
                        <a  href="http://www.webtrackerplus.com/?a_aid=51a4de24b6608&amp;a_bid=99507c09" target="_blank"><img src="http://www.affiliate-robot.com/accounts/default1/banners/stream%20thousands%20of%20movies%20in%20hd%20black.jpg" alt="" title="" /></a>
                    </div>
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    private static function get_clickBank($zone)
    {
        include('config.php');
        $codes['udnmovies.info']['title'] = ''; //TODO:Find how different codes are assembled, now use satic below

        //$domain = ad::get_domain();
        $domain = 'udnmovies.info'; //forced override
        $output = '';

        if($codes[$domain]) //make sure the domain has an entry above
            switch ($zone)
            {
                case 'title':
                    ob_start(); ?>
                    <a href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/" target="_top">
                        <img src="http://affiliate-robot.com/accounts/default1/banners/download_now.png" alt="" title="" width="158" height="21" />
                    </a>
                    <?php $output = ob_get_clean();
                    break;
                case 'title_2':
                    ob_start(); ?>
                    <a href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/">
                        <img src="http://affiliate-robot.com/accounts/default1/banners/download_now.png" />
                    </a>
                    <?php $output = ob_get_clean();
                    break;
                case 'center_banner_1':
                    ob_start(); ?>
                    <a href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/"><img class="nohover" src="http://cdn1.clkrev.com/ext/ibario/27/dpp_728_90_blue-copy.png" alt="" title="" width="728" height="90" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'center_banner_3':
                    ob_start(); ?>
                    <a href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/"><img class="nohover" src="http://<?=$res_server?>/res/img/mymoviepass_728x90anim.gif" alt="" title="" width="728" height="90" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'left_box_1':
                    ob_start(); ?>
                    <a  href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/" target="_blank"><img src="res/img/stream.jpg" alt="" title="" style="width:214px;" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'left_bar_1':
                    ob_start(); ?>
                    <a  href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/" target="_blank"><img src="http://www.affiliate-robot.com/accounts/default1/banners/watch%20movies%20anytime%20anywhere.jpg" alt="" title="" /></a>
                    <?php $output = ob_get_clean();
                    break;
                case 'download_page_center':
                    ob_start(); ?>
                    <a  href="http://ac50alrhb0dpfkffsik6z-1dwx.hop.clickbank.net/" target="_blank"><img src="http://www.affiliate-robot.com/accounts/default1/banners/stream%20thousands%20of%20movies%20in%20hd%20black.jpg" alt="" title="" /></a>
                    <?php $output = ob_get_clean();
                    break;
            }
        return $output;
    }

    public static function get_analytics()
    {
        $domain = ad::get_domain();

        $analytics['earnmovie.com'] =       'UA-39275700-1';
        $analytics['getmovielinks.com'] =   'UA-39268219-1';
        $analytics['moviezfind.com'] =      'UA-39276500-1';
        $analytics['moviezhunt.com'] =      'UA-39267121-1';
        $analytics['trendx.info'] =         'UA-36430534-1';
        $analytics['ttmoviez.com'] =        'UA-39270318-1';
        $analytics['udnmovies.com'] =       'UA-40854707-1';
        $analytics['torrentmovies.de'] =    'UA-41474724-1';
        $analytics['sharptorrents.com'] =   'UA-41653502-1';

        $analytics['udnmovies.info'] =   'UA-41845141-1';
        $analytics['udnfind.info'] =   'UA-41845141-2';
        $analytics['movieshunt.info'] =   'UA-41845141-3';
        $analytics['moviesfind.info'] =   'UA-41845141-4';
        $analytics['ttmovies.info'] =   'UA-41845141-5';


        $output = '';
        ob_start(); ?>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '<?=$analytics[$domain]?>']);
        _gaq.push(['_trackPageview']);

        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
    <?php $output = ob_get_clean();

        return $output;
    }

}